#ifndef __VCD_USB_REDIR_H__
#define __VCD_USB_REDIR_H__
#include <gtk/gtk.h>
//#include <spice-types.h>
#include "config.h"
#include "spice-client.h"
G_BEGIN_DECLS

#ifdef USE_USBREDIR

typedef struct UsbOneState{
    gint64 vendor_id;
    gint64 product_id;
	gboolean redir_state;
}UsbOneState;

typedef struct UsbRedirOneVm{
	gchar ip[32];
	gint  port;
    GPtrArray *arr;// array UsbOneState
}UsbRedirOneVm;

typedef struct UsbRedirState{
    gboolean flag; //wether apply all

	// array UsbOneState if apply_all is TRUE
    GPtrArray *arr_apply_all;

	//array UsbRedirOneVm if if apply_all is FALSE
    GPtrArray *arr_apply_differ;

    gchar cur_ip[32];
    gint cur_port;
}UsbRedirState;

typedef struct _VcdUsbRedir{
    SpiceSession *session;
    GtkWidget *redir_win;
    GtkWidget *mother_window;
}VcdUsbRedir;

gboolean vcd_usb_redir(GtkWidget* btn, gpointer pt);
VcdUsbRedir* create_vcd_usb_redir(SpiceSession *session, GtkWidget *mother_window);
int destroy_vcd_usb_redir(void);

int init_usb_redir_operate_callback(SpiceSession *session, const gchar* ip, const char* port);

#endif

G_END_DECLS
#endif
